import React from 'react';
import useStore from "../../store";

function Index({data}) {
    const {getLevelById} = useStore();

    return (
        <div
            className="w-full h-48 rounded-lg shadow-md border flex flex-row justify-start    cursor-pointer
          p-1
           ">
            <div className="w-36 h-full  ">
                <img className="size-full cursor-pointer rounded-lg"
                     src={data.shop_logo}
                     alt="1"/>
            </div>
            <div className="px-2.5 py-2 flex flex-col justify-start flex-1">
                <div className='flex justify-start items-center'>
                    <div className="w-36 h-9  ">
                        <img className="size-full cursor-pointer rounded-lg"
                             src={getLevelById(data.real_level_id).picture}
                             alt={getLevelById(data.real_level_id).level_name}/>
                    </div>

                    <p className="font-bold text-lg	mx-1">{data.shop_name}</p>
                </div>
                <div className="flex justify-between">
                    <div className="text-red-500">联系人：{data.ywy_name}</div>
                    <div className="text-red-500">电话：{data.phone}</div>
                    <div className="text-stone-400	">浏览量：{data.visit_num}</div>
                </div>
                <div
                    className="h-12 w-full overflow-hidden text-ellipsis line-clamp-2  text-stone-400">地址：{data.shop_address}</div>
                <div className="h-12 w-full overflow-hidden text-ellipsis line-clamp-2 ">主营：{data.zypp}</div>
            </div>
        </div>
    );
}

export default Index;